import request from '@/utils/request'

//优惠券列表
export function couponList(params: any) {
    return request.get({ url: '/system/coupon/list', params })
}
//新增优惠券
export function addCoupon(params: any) {
    return request.post({ url: '/system/coupon/add', params })
}
//优惠券详情
export function couponDetail(params: any) {
    return request.get({ url: '/system/coupon/detail', params })
}
//优惠券编辑
export function couponEdit(params: any) {
    return request.post({ url: '/system/coupon/edit', params })
}
//开始发放优惠券
export function couponDistribute(params: any) {
    return request.post({ url: '/system/coupon/enable', params })
}
//结束发放优惠券
export function couponEndDistribute(params: any) {
    return request.post({ url: '/system/coupon/disable', params })
}
//优惠券删除
export function couponDel(params: any) {
    return request.post({ url: '/system/coupon/del', params })
}
//领取记录列表
export function recorderList(params: any) {
    return request.get({ url: '/system/coupon_receive/list', params })
}

//作废用户领用的优惠券
export function couponCancel(params: any) {
    return request.post({ url: '/system/coupon_receive/cancel', params })
}
//不同状态的优惠券个数
export function couponCount(params?: any) {
    return request.get({ url: '/system/coupon/count', params })
}

//所有管理员列表
export function allAdmin(params?: any) {
    return request.get({ url: '/system/admin/all', params })
}

//不同状态的领用明细个数
export function recorderCount(params?: any) {
    return request.get({ url: '/system/coupon_receive/count', params })
}

//发放优惠券列表
export function provideCouponList(params?: any) {
    return request.get({ url: '/system/coupon/available', params })
}

//发放优惠券于用户
export function provideCoupon(params?: any) {
    return request.post({ url: '/system/coupon/provide', params })
}
